package com.ly.aidlpratice.client

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        //通过Messenger与远程服务通信
        findViewById<Button>(R.id.button).setOnClickListener {
            gotoActivity(MessengerActivity::class.java)
        }

        findViewById<Button>(R.id.button1).setOnClickListener {
            gotoActivity(HandwrittenActivity::class.java)
        }
    }

    private fun gotoActivity(clazz: Class<*>) {
        startActivity(Intent(this, clazz))
    }
}